#include <iostream>
using namespace std;

const int maxn = 100005;

int f[maxn], x[maxn], up[maxn];
int n, q, f1, f2, a, b;

void init_f()
{
	f[0] = f1;
	f[1] = f2;
	for (int i = 2; i < n; i++)
		f[i] = a * f[i-2] + b * f[i-1];
}

int main()
{
	cin >> n >> q >> f1 >> f2 >> a >> b;
	init_f();
	for (int i = 0; i < n; i++) cin >> x[i];
	for (int i = 0; i < q; i++) {
		int l, r;
		cin >> l, r;
		up[l-1] += 
	}
}
